package flinkdemo.faceSink;

public class PrintLogPlugin implements LogTimestampPlugin {
    private int index = 0;
    private String prefix = "";
    private String logPath = "";

    public PrintLogPlugin() {
    }

    @Override
    public void logTimestamp(String id, long timestamp, String value) throws Exception {
        System.out.println(String.format("%s_%d\t%s\t%d\t%s", this.prefix, this.index, id, timestamp, value));
    }

    @Override
    public void open(String logPath, String prefix, int index) throws Exception {
        this.index = index;
        this.prefix = prefix;
        this.logPath = logPath;
        System.out.println(String.format("%s_%d_%s", prefix, index, logPath));
    }

    @Override
    public void close() throws Exception {
    }
}
